package izzat.fit.dbservice.controller;

import izzat.fit.dbservice.entity.action.Action;
import izzat.fit.dbservice.entity.mine.User;
import izzat.fit.dbservice.entity.training.Plan;
import izzat.fit.dbservice.service.ActionService;
import izzat.fit.dbservice.service.MineService;
import izzat.fit.dbservice.service.TrainingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName: DbServiceController
 * @Description:
 * @Author: Izzat
 * @Date: 2019-12-29 16:57
 * @Version: v1.0
 */
@RestController
@RequestMapping("db-service")
public class DbServiceController {
    @Autowired
    private MineService mineService;
    @Autowired
    private TrainingService trainingService;

    @RequestMapping("test")
    public String testConnect(){
        return "DBServiceController";
    }

    @RequestMapping("allUser")
    public List<User> getAllUser(){
        return mineService.getAllUser();
    }


    @RequestMapping("allPlan")
    public List<Plan> getAllPlan(){
        return trainingService.getAllPlan();
    }
}
